import pyautogui
from PIL import Image
from mouseinfo import screenshot
from pyscreeze import pixel

# pyautogui.moveTo(490,700,duration=0.5)
# pyautogui.click()
# pyautogui.click()
# pyautogui.moveTo(600,700,duration=0.5)
# pyautogui.click()
# # pyautogui.dragTo(500,500,duration=1)
# pyautogui.typewrite('hello world')
# pyautogui.keyDown('enter')
# pyautogui.keyUp('enter')
# pyautogui.moveTo(0,0)
width,height = pyautogui.size()
print(f'屏幕宽度{width},屏幕高度{height}')

location = pyautogui.locateOnScreen('写字本.png')
if location is not None:
    center = pyautogui.center(location)
    print(center)
    pyautogui.doubleClick(center)

screenshot = pyautogui.screenshot()
x = 124
y = 10\

pixel_color = screenshot.getpixel((x,y))
print(f'坐标（{x},{y}）的颜色是{pixel_color}')